﻿
namespace Patterns4Net.ArchitectureExplorer.Infrastructure
{
    using System;
    using System.Windows.Threading;

    public class Dispatcher : IDispatcher
    {
        private readonly DispatcherObject dispatcherObject;

        public Dispatcher(DispatcherObject dispatcherObject)
        {
            this.dispatcherObject = dispatcherObject;
        }

        public void BeginInvoke(Action action)
        {
            this.dispatcherObject.Dispatcher.BeginInvoke(new ActionDelegate(action));
        }

        private delegate void ActionDelegate();
    }
}
